const fs = require('fs')
const path = require('path')

function getFile(fileName, callback) {
	const fullName = path.resolve(__dirname, '', 'fileName')
	fs.readFile(fullName, (err, data) => {
		if (err) {
			console.error(err)
			return 
		}
		callback(JSON.parse(data.toString()))
	})
}

getFile('a.json', aData => {
	console.log('aData', aData)
	getFile('b.json', bData => {
		console.log('bData',bData)

		getFile('c.json', cData => {
			console.log('cData', cData)
		}) 
	})
})
